﻿using System;
using System.ServiceModel;
using VideoStore.Services.Dto;
using VideoStore.Common.Response;

namespace VideoStore.Services.Interface
{
    [ServiceContract(Namespace = "VideoStore.Services.OrderService")]
    public interface IOrderService
    {
        /// <summary>
        /// Gets the order by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        [OperationContract]
        Response<OrderDto> GetOrderById(Guid id);

        /// <summary>
        /// Creates the order.
        /// </summary>
        /// <param name="newOrder">The new order.</param>
        /// <returns></returns>
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        Response<OrderDto> CreateOrder(OrderDto newOrder);

        /// <summary>
        /// Submits the order.
        /// </summary>
        /// <param name="orderId">The order id.</param>
        /// <returns></returns>
        [OperationContract]
        [TransactionFlow(TransactionFlowOption.Allowed)]
        Response<OrderDto> SubmitOrder(Guid orderId);
    }
}
